package com.apex.restful.controller;

import com.apex.restful.service.MessageApproveService;
import com.apex.security.api.service.MessageApproveRestfulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-4-7
 */
@RestController
public class MessageApproveController implements MessageApproveRestfulService {

    @Autowired
    private MessageApproveService service;

    @Override
    public String getEntity(@RequestParam("messageId")Integer messageId) {
        return service.getEntity(messageId);
    }

    @Override
    public String getByUserId(@RequestParam("userId")String userId,
                              @RequestParam("current")Integer current,
                              @RequestParam("rows")Integer rows,
                              @RequestParam(name = "title",required = false,defaultValue ="null")String title) {
        return service.getByUserId(userId,current,rows,title);
    }
}
